package com.kalvan.web.feign.client;

import com.kalvan.client.model.Request;
import com.kalvan.client.model.Response;
import com.kalvan.web.feign.client.fallback.SccApiFallbackFactory;
import com.kalvan.web.feign.client.req.DictRequest;
import com.kalvan.web.feign.client.req.MockRequest;
import com.kalvan.web.feign.client.res.DictResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.validation.Valid;
import java.util.List;

/**
 * 服务控制
 *
 * @author chenliang
 */
@FeignClient(name = "scc", path = "scc",
        fallbackFactory = SccApiFallbackFactory.class)
public interface SccMockClient {
    /**
     * 获取mock配置
     *
     * @param request 请求参数
     * @return mock地址, 建议配置YApi mock地址
     */
    @RequestMapping(value = "getMockUrl", method = RequestMethod.POST)
    Response<String> getMockUrl(@Valid @RequestBody Request<MockRequest> request);
}
